package com.apollographql.apollo.api.internal.json;

import com.kt.Metadata;
import com.kt.Unit;
import com.kt.jvm.functions.Function1;
import com.kt.jvm.internal.Intrinsics;

import java.io.IOException;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0018\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a(\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0019\b\u0004\u0010\u0003\u001a\u0013\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u00010\u0004¢\u0006\u0002\b\u0005H\b\u001a(\u0010\u0006\u001a\u00020\u0001*\u00020\u00022\u0019\b\u0004\u0010\u0003\u001a\u0013\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u00010\u0004¢\u0006\u0002\b\u0005H\b¨\u0006\u0007"}, d2 = {"writeArray", "", "Lcom/apollographql/apollo/api/internal/json/JsonWriter;", "block", "Lkotlin/Function1;", "Lkotlin/ExtensionFunctionType;", "writeObject", "apollo-api"}, k = 2, mv = {1, 4, 0})
/* compiled from: JsonWriters.kt */
public final class JsonWritersKt {
    public static final void writeObject(JsonWriter $this$writeObject, Function1<? super JsonWriter, Unit> function1) {
        Intrinsics.checkParameterIsNotNull($this$writeObject, "$this$writeObject");
        Intrinsics.checkParameterIsNotNull(function1, "block");
        try {
            $this$writeObject.beginObject();
            function1.invoke((Comparable) $this$writeObject);
            $this$writeObject.endObject();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    public static final void writeArray(JsonWriter $this$writeArray, Function1<? super JsonWriter, Unit> function1) {
        Intrinsics.checkParameterIsNotNull($this$writeArray, "$this$writeArray");
        Intrinsics.checkParameterIsNotNull(function1, "block");
        try {
            $this$writeArray.beginArray();
            function1.invoke((Comparable) $this$writeArray);
            $this$writeArray.endArray();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
